﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="DateSelector.ascx.vb" Inherits="UserControls_DateSelector" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<link rel="stylesheet" href="../Scripts/popcalendar.css"/>
<link rel="stylesheet" href="../Scripts/Style.css">
<script language="JavaScript" src="../Scripts/popcalendar.js"></script>
<TABLE id="tbl_control" cellSpacing="0" cellPadding="0" border="0" runat="server">
	<TR>
		<TD><asp:label id="lblDate" Font-Bold="true" runat="server"></asp:label></TD>
		<TD><asp:textbox id="txt_Date" runat="server" Columns="8" ReadOnly="True" BorderStyle="Groove" CssClass="textbox"></asp:textbox></TD>
		<TD><asp:image id="imgCalendar" runat="server" ImageUrl="../Images/calendar.gif"></asp:image></TD>
		<td><font color=Red>&nbsp;(dd/mm/yyyy)</font></td>
		<td>
			<asp:CustomValidator id="validateDate" runat="server" ClientValidationFunction="DateValidate" ErrorMessage="Invalid Date!"
				ControlToValidate="txt_Date"></asp:CustomValidator>
		</td>
	</TR>
</TABLE>

<script language="javascript" type="text/javascript">
    function DateValidate(source, arguments) {
        if (isDate(arguments.Value))
            arguments.IsValid = true

        else
            arguments.IsValid = false
    } 

</script>